how to add a simple message to a php-gtk statusbar? - gtk2

I have a simple GtkStatusBar created with glade,and want to add a simple message with the date of the last update of the database (just a simple and plain date).
I don't want to use the whole stacks, context and all the other things that gtk developers put on the statusbar code.
(I could simply use a label but I would like to keep the drag bar).
I'm using Gtk 2.0.1 with php 5.2.6;

try
http://www.kksou.com/php-gtk2/articles/have-a-status-area-using-GtkStatusbar.php
To display a message, we need to first get a message id with GtkStatusbar::get_context_id(), then display the message with GtkStatusbar::push().

Related

Creating a panel for displaying default information in kivy

I'm new to kivy. Currently working on building an application in kivy.
My need to is to display some default information on top of the application (say for example., date, time ..)
Please suggest me a way to do that
I came across action bar in kivy but unable to add that in my currently built application.
The simplest way that I would approach this is to create a row of labels at the top of your screen. One would display the date, the next would display time, etc. Use the Kivy clock to update them every second.

C++ Windows Forms - Password Strength

I've been following YouTube tutorials most of the day now and I think I've got the basic hang of forms. I'm aiming to create something like this below, which checks a users password and shows how strong it is:
This is what I have at the moment:
I'd like to know the basic theory behind how the top form works, specifically how I can take the user input of password in my form and just get it to print and update in realtime underneath below. I'm not quite sure what tool is used to do that, or for that matter what tool is used to create the colour changing box.
Any help or direction is appreciated, thanks!
Add a keyboardListener to your jtextfield. When a key is pressed get the text and do your stuff(figure out the strength, number of Uppercase etc)
Is this win32 or mfc forms, or some other tech like Qt or wxWidgets?
In both cases you will want to handle messages from the edit field as text is changed in it. This message is the EN_CHANGE message. Handle that message and you can get the text from the edit field and send messages to the strength form to tell it to change its color and text.
Add a System::Windows::Forms::KeyPressEventHandler (or similar) to the TextBox. When raised, do whatever analysis you need to do on the string and update the table below. The color changing box can be one of many implementations. It can be something as simple as a panel that changes its background with a System::Windows::Forms::Label positioned on top of it. It actually looks like that, as the text is not centered.

Qt: Best control for displaying chat messages

I have been trying to use a textBrowser in order to display chat messages in my application. I've set the textBrowser with HTML enabled. I'm then appending each message to the textBrowser like so:
ui->textBrowser->append(QString().sprintf("<div style=\"border-bottom:1px solid #eeeeee; background-color:#ffffff;display:block;\"><font color=\"red\"> %s</font></div>",msg.toStdString().c_str()));
However, I am limited in what CSS i can apply to each appended element. For example;
- Border does not work
- Display block does not work
- etc.
I'm now fairly certain that the textBrowser just does not have the power that i need, I'm aiming in creating a chat message much like Skype is doing it.
What would be the best control to use for this purpose?
Some ideas I have so far:
- Use a scrollArea and append widgets inside of them
- Use a listView (not sure if its possible to style it the way i want)
Key elements i want to include in each chat message are:
- Time
- Avatar picture
- Name
- Text message
Any ideas what the best approach would be here?
Edit
Unfortunately i cant attach an image yet since I'm still new here.
I think you could simply use the WebKit (WebView) component. That will allow you to do anything you need and more. Styling and layout is done like a regular HTML/CSS page, then you can integrate it to the application backend via JavaScript.

Using custom pushpins in my Windows 8.1 XAML app using Bing Maps SDK

In my C++/XAML Windows 8.1 app, I want to use a pushpin to denote a location that the user has selected. The default pushpin is very limited and it doesn't even show all the text I add to the "Text" field of the pushpin.
I really want to show something similar to the default pushpin and under that a textblock with some text.
So I think I have to create a user control and use it as a custom pushpin. However, when I do this the "custom pushpin" doesn't appear on the map at the same location that the user selected. It feels like in order to get it at the same location, I need to get the margins of the user control right through hit and trial. What is the correct way to achieve what I am trying to do?
After playing around a little more, I was able to specify the correct position of the custom pushpin using the following API:
Bing::Maps::MapLayer::SetPositionAnchor(Windows::UI::Xaml::DependencyObject^, Windows::Foundation::Point)
See the API reference here.

How can I visually design a component in C++ Builder?

I have been away from C++ for a couple of years now doing AS3/Flex work. I have gotten used to being able to create a component and place it in design mode with very little fuss and I am struggling to get my head around the C++ Builder way of doing the same thing.
I have written many components for C++ Builder in the past, but none of them have been visual. What I would like to do now is create a component for customer search and another for order processing because I want to be able to create a new instance of these on the fly. What I don't want to do is have to place each of the components like the dbgrid and search fields manually in code. I would like to do this (as well as set their properties) in design mode.
How do I go about this? I have browsed the source for other Delphi components and I notice they have dfm files which seems to be what I need. How do I do this in C++ Builder? The only option I see is to add a new form if I want a dfm, but this isn't what I want as my components will be based on TPanel.
Is there a way to do this or do I have to resort to doing it all in code with no visual reference?
Pursuing the DFM idea I did a test this morning where I created a component based on TPanel and added a new form to it which I create and parent in the constructor of the component. In design mode I set the form border to none and placed a grid on it. This all looks OK until I place the component in my application, at that point it looks like a panel with a standard looking form in it and the grid is missing. If I run the app the panel shows as expected, borderless and with a grid. The DFM appears to be ignored in design mode for some reason.
If you know a better way to do this than using components then please give me some pointers.
Any help and advice will be appreciated beyond words
You might want to have a look at frames (look for "Frame objects"). They are "subforms" you can design visually and then place on forms.
Just as an FYI item, you can also drop the panel on a form, put any other controls on it, position them, set captions, etc..
Now, click the panel to select it, and use Component->Create Component Template from the IDE's main menu. This creates a unit you can install as a component which will add the panel and it's sub-controls (as a single component) to the IDE's component palette.
Of course, you can then modify the source for that new component like any other component source.