UGN Security Forums

 You are not logged in. [Log In] UGN Security Forums » Forums » UGN Security: Knowledge Base » Operating Systems      » Windows & Windows Security » php-GTK+ to develope GUI's for windows Register User    Portal Page     Forum List        Calendar     Active Topics    FAQ
 November Su M Tu W Th F Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
 #14999 - 10/04/03 06:47 PM Re: php-GTK+ to develope GUI's for windows Learner2 Junior Member Registered: 10/03/03 Posts: 7 Okay so I am starting on this. This is my first thing. I modified the sample hello.php code that came with the zip file.php-gtk-0.5.2a-win32.zip Code: destroy(); } $window = &new GtkWindow();$window->connect('destroy', 'destroy'); $window->connect('delete-event', 'delete_event');$window->set_border_width(10); $button = &new GtkButton('Close');$button->connect('clicked', 'buttons'); $window->add($button); $tt = &new GtkTooltips();$tt->set_delay(200); $tt->set_tip($button, 'Closes out this Window', ''); $tt->enable(); /*realize the underlying GdkWindow, flag the GtkWindow's visibility and map it onto the screen, all in one simple line*/$window->show_all(); /*without the main loop, there is no PHP-GTK script*/ Gtk::main(); ?> I can get it up and running and it dose what I want it to but I have trouble adding widgets to it. The whole adding a child widget to the parrent is screwing me up or maybe my syntax is fucked. Can anyone breake this down for me in forest gump terms? I know a widget is basicaly equal to an object in other languages. I am talking the child parent relationshipWhy some widgets can only have one child and others unlimited. Top
 #15000 - 10/05/03 05:57 AM Re: php-GTK+ to develope GUI's for windows §intå× Registered: 12/03/02 Posts: 3255 Loc: Maryland Okay I am catching on. In order to set a widget inside another you have to specify using something like$window->add($vbox);This puts a verticle box inside the window. A sort of likeness to tables in HTML Here is what I have so far. Quote: For all those geeks who might still be wondering what is happening. Just do this... Unzip the zip package into the c:\ directory - that will do. And then start rolling. Check whether it is working by going into c:\php4 and typing this php c:\test\gtk.php _________________________ My New site OpenEyes Top
 #15001 - 10/05/03 08:27 PM Re: php-GTK+ to develope GUI's for windows Learner2 Junior Member Registered: 10/03/03 Posts: 7 Okay moving along. My little learning script can connect to a database. I want to place an image in this puppy. A red sphear if it can not connect and a blue one if it can. To do this I need to use the Gdk widget GtkPixmapNow here is what I have found so far on this http://gtk.php.net/manual/en/gtk.gtkpixmap.php Quote: pixmap_create_from_xpm can not load c:\path\to\image\my_image.png So duh, It is looking for an image with an xmp extension right? How the hell do I create on. I have photoshop, paint(of course), Flash, and paintshop pro. None of which will creat a xmp extension. Or I can create it but it is not truely creating this extension file type. Any help?My code so far is shown below. It will now connect to a MySQL database and extrat data to dissplay in the GUI. I will get to making that more dynamic later.Code: destroy(); } // $window = &new GtkWindow();$window->connect('destroy', 'destroy'); $window->connect('delete-event', 'delete_event');$window->set_border_width(10); $window->show(); //$Hbox_start = &new GtkHBox(false, 5); $window->add($Hbox_start); // $vbox = &new GtkVBox(false, 5);$Hbox_start->add($vbox); // // //$frame = &new GtkFrame("Close section"); $frame->set_label("Click to exit");$frame->set_label_align(0.0, 0.5); $frame->set_shadow_type(GTK_SHADOW_ETCHED_IN);$frame->show(); $vbox->pack_start($frame, true, true, 5); // // $hbox1 = &new GtkHBox(false, 5); // //$label = &new GtkLabel(); $label->set_text("To close this window all you have \n to do is click on the button below. \n But be warned!! I can not be held \n responsible for what else it might do.");$label->set_justify(GTK_JUSTIFY_LEFT); $frame->add($label); $label->show(); // //$hbox2 = &new GtkHBox(false, 5); $vbox->add($hbox2); // // $button = &new GtkButton('Close');$button->connect('clicked', 'buttons'); $button->show();$hbox2->pack_start($button, true, true, 5); // // //$tt = &new GtkTooltips(); $tt->set_delay(200);$tt->set_tip($button, 'Closes out this Window', '');$tt->enable(); // $vbox_section2 = &new GtkVBox(false, 5);$Hbox_start->add($vbox_section2); //$frame2 = &new GtkFrame("Close section"); $frame2->set_label("Database connection");$frame2->set_label_align(0.0, 0.5); $frame2->set_shadow_type(GTK_SHADOW_ETCHED_IN);$frame2->show(); $vbox_section2->pack_start($frame2, true, true, 5); // // $db_conn = mysql_connect ("address to server", Login, password); mysql_select_db(Login,$db_conn); $name = mysql_query("SELECT * FROM Userinfo Where id = '1'"); while($name2 = mysql_fetch_array($name)) {$handle = "".$name2['First']." ".$name2['Last'].""; } // if ($db_conn){$label2 = &new GtkLabel(); $label2->set_text("Hello$handle, \n If you are reading this \n then you are connected \n to the database."); $label2->set_justify(GTK_JUSTIFY_LEFT);$frame2->add($label2);$label2->show(); }else{ $label2 = &new GtkLabel();$label2->set_text("mySQL Error: ".mysql_error()); $label2->set_justify(GTK_JUSTIFY_LEFT);$frame2->add($label2);$label2->show(); } // /*realize the underlying GdkWindow, flag the GtkWindow's visibility and map it onto the screen, all in one simple line*/ // $window->show_all(); // /*without the main loop, there is no PHP-GTK script*/ // Gtk::main(); ?> Top  Hop to: UGN Security: Underground ------ General Phreaking Gaming Newbie Questions Recommended Systems Security Whitepapers News Open News Technology Site News Reviews Review Requests Hardware and Electronics Movies and Music Video Games Software Services Off Topic Debates & RantsUGN Security: Knowledge Base ------ Graphics & Multimedia The Studio Online Swapmeet Electronics Programming C/C++ VB Web Design, Protocols & Other Languages Operating Systems Windows & Windows Security Macintosh *nix & *nix SecurityUGN Security: UGN ------ UGN Suggestions UGN Store UGN Bugs Archives Open News Tech News  Featured Member Registered: 10/28/14 Posts: 1  Forum Stats 2150 Members 46 Forums 35738 Topics 70908 Posts Max Online: 1567 @ 04/25/10 05:20 AM Top Posters  UGN Security 28899 Gremelin 7193 §intå× 3255 SilentRage 1273 Ice 1146 pergesu 1136 Infinite 1041 jonconley 955 Girlie 908 unreal 860  Newest Members HushHush, golqm, Tim050, Gecko666, defghi795767 2150 Registered Users  Who's Online 0 registered (), 349 Guests and 293 Spiders online. Key: Admin, Global Mod, Mod  Latest News luxury goods sales at$405B by 2019 by golqm 10/28/14 05:19 AM